package com.house.rent.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;

import com.base.lib.mvp.present.BasePresenter;
import com.house.rent.R;
import com.house.rent.util.PreferencesUtils;

import butterknife.BindView;

/**
 * @author neo.duan
 * @date 2019-12-25 17:03
 * @desc 请输入文件描述
 */
public class ApiActivity extends BaseActivity {

    @BindView(R.id.edt_api)
    EditText mEdtApi;


    public static void start(Context context) {
        Intent starter = new Intent(context, ApiActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected void initTop() {
        setTitle("服务器设置");
        enableRight("保存", v -> {
            PreferencesUtils.putBaseUrl(mEdtApi.getText().toString().trim());
            showMessage("保存成功");
            finish();
        });
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_api;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        mEdtApi.setText(PreferencesUtils.getBaseUrl());
    }

    @Override
    protected void initListeners() {

    }

    @Override
    protected BasePresenter initPresenter() {
        return null;
    }

    @Override
    protected void initData() {

    }
}
